
<template>
	<div class="p_container">
		
		<el-menu unique-opened
			:collapse="isCollapse"
			:default-active="activeIndex"
			class="el-menu-vertical-demo" 
			mode="vertical"
			background-color="#0a1f34"
			text-color="hsla(0,0%,100%,.65)"
			active-text-color="#409eff" router>
			<sidebar-item :menuList="menuList" ></sidebar-item>
		</el-menu>
	</div>
</template>
<script>
	import sidebarItem from './sidebarItem'
	
	import { mapGetters } from 'vuex'
	import { menus } from '@/const/menus'
	export default {
		name:'sidebar',
		components:{
			sidebarItem
		},
		data(){
			return{
				activeIndex:this.$route.path,
				menuList:[]
			}
		},
		created(){
			this.menuList = menus;
			// this.$store.dispatch('GetMenu').then(data => {
			// 	this.$notify({
		 //          title: '获取菜单',
		 //          message: this.menu,
		 //          type: 'success'
		 //        });
			// });

			// this.menuList = this.menu;
		},
		computed:{
			...mapGetters(['menu','isCollapse'])
		},
		methods:{
		}
	}
</script>
<style scoped>
	.p_container{
		background:rgb(10, 31, 52) ;
		height: 100%;
	}
	.el-menu-vertical-demo.el-menu{
		border-right: none;
	}
	/*.el-menu-vertical-demo:not(.el-menu--collapse) {
	    width: 200px;
	  }*/
</style>